package com.shrct.businessprocess.purchase.events;

import com.shrct.businessprocess.purchase.RCPurchaseOrder;
import com.shrct.businessprocess.purchase.events.RCPurchaseOrderEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.purchase.events.RCPurchaseOrderEventsManager")
public class RCPurchaseOrderEventsManager extends EntityEventsManager<RCPurchaseOrder> {
  @Autowired(required = false)
  private Collection<RCPurchaseOrderEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCPurchaseOrderEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireStartAudit(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).startAudit(entity);
    }
    
  }
  
  public void fireAuditPassed(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).auditPassed(entity);
    }
    
  }
  
  public void fireAuditCanceled(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).auditCanceled(entity);
    }
    
  }
  
  public void firePostCancel(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).postCancel(entity);
    }
    
  }
  
  public void fireAcceptItem(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).acceptItem(entity);
    }
    
  }
  
  public void firePayRequest(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).payRequest(entity);
    }
    
  }
  
  public void fireInvoiceRegister(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).invoiceRegister(entity);
    }
    
  }
  
  public void fireClose(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).close(entity);
    }
    
  }
  
  public void fireCancelClose(final RCPurchaseOrder entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCPurchaseOrderEventsListener)listener).cancelClose(entity);
    }
    
  }
}
